define(['api'],function (api) {
    var template="";
    template += "    <li class=\"searchBox\">";
    template += "        <div class=\"searchInput pr\">";
    template += "            <input type=\"text\" v-model='searchword' placeholder=\"查询\"\/>";
    template += "            <i v-on:click=\"blocksearch\"><\/i>";
    template += "        <\/div>";
    template += "    <\/li>";

    var SearchBox={
        name:"search-box",
        template:template,
        /*
         "    <li class=\"searchBox\">"
    + "        <div class=\"searchInput pr\">"
    + "            <input type=\"text\" placeholder=\"查询\"\/>"
    + "            <i><\/i>"
    + "        <\/div>"
    + "    <\/li>"
    ,*/
        data: function () {
            return {
                selectedWilling: "nomal",
                buyWillings: [
                    {label: "意向强烈", value: "strong"},
                    {label: "意向一般", value: "normal"},
                ],
                searchword:"",

            }
        },
       // props:['searchurl'],//搜索时访问的url.
        methods:{
            blocksearch:function(){
                var that=this;
                var searchurl= api.fetchPlotSearchData({pagesize:10,pageindex:1,searchword:this.searchword})
                    .done(function (data) {
                        window.bus.$emit("blocksearch",data);
                    })


            }
        }
    }
    return SearchBox
})
